package com.nbufe.strategy.demo1;

/**
 * @Author Zan
 * @Create 2024/5/15 14:47
 * @ClassName: SaleTicket
 * @Description : TODO 请用一句话描述该类的功能
 */
public class SaleTicket {

    private double price;

    private Discount discount;

    public SaleTicket(Discount discount) {
        this.discount = discount;
    }

    public double getPrice() {
        return discount.calculate(this.price);
    }

    public void setPrice(double price) {
        this.price = price;
    }
}
